#构建Android
BuildProject=LitBuild_Android.BuildReleaseProject
BuildApk=LitBuild_Android.BuildReleaseApk
BuildBundle=LitBuild_Android.BuildReleaseBundle
BuildUnity=BuildScripts/build-unity.sh
# $(pwd) /Users/user1/.jenkins/workspace/lit-game-framework-minigame
UnityProjectPath=$(pwd)
AndroidProjectPath=$(pwd)/Build/Android_Release/Project/release_project

if [ $1 = 'Apk' ];then
    #构建Apk
    echo BuildApk -Begin
    sh $BuildUnity $UnityProjectPath $BuildApk
    echo BuildApk -End
    #通讯软件发送消息
    echo SendMessage -Begin
    
    echo SendMessage -End
elif [ $1 = 'Project' ];then
    #构建安卓工程
    echo BuildAndroidProject -Begin
    sh $BuildUnity $UnityProjectPath $BuildProject
    echo BuildAndroidProject -End
    #gradle构建
    echo GradleBuild -Begin
    cd $AndroidProjectPath
    #$Gradle wrapper
    #./gradlew assembleRelease || exit 1
    $Gradle assembleRelease || exit 1
    echo GradleBuild -End
    #通讯软件发送消息
    echo SendMessage -Begin
    
    echo SendMessage -End
else
    #构建安卓资源
    echo BuildAndroidBundle -Begin
    sh $BuildUnity $UnityProjectPath $BuildBundle
    echo BuildAndroidBundle -End
    #通讯软件发送消息
    echo SendMessage -Begin
    
    echo SendMessage -End
fi
